import 'package:flutter/material.dart';

import 'trtc/trtc.dart';
import 'videoplayer/video_player_page.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  final GlobalKey<NavigatorState> navigatorKey =
  new GlobalKey<NavigatorState>();

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      navigatorKey: navigatorKey,
      home: Scaffold(
          appBar: AppBar(
            title: const Text('Plugin example app'),
          ),
          body: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: <Widget>[
              RaisedButton(
                onPressed: () {
                  BuildContext buildContext = navigatorKey.currentState.overlay.context;
                  Navigator.push(buildContext, MaterialPageRoute(builder: (buildContext) {
                    return Trtc();
                  }));
                },
                child: Text('腾讯实时音视频'),
              ),
              RaisedButton(
                onPressed: () {
                  BuildContext buildContext = navigatorKey.currentState.overlay.context;
                  Navigator.push(buildContext, MaterialPageRoute(builder: (buildContext) {
                    return VideoPlayerPage();
                  }));
                },
                child: Text('腾讯云播放器'),
              )
            ],
          )),
    );
  }
}
